﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Write.aspx.cs" Inherits="Write" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>설치형UCC 프로젝트 - UCCLIGHT</title>
    <link href="Common.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <script type="text/javascript">
        function SetThumbCandidates(str) {
            //alert(str);
            if (str == "") {
                alert("용량을 초과하였습니다.");
                return;
            }
            document.getElementById("<%= hdnFileName.ClientID%>").value = str;

            //alert(str);
            //alert(str);
           /* var retStr =  str.split('/');
            
            var hdnThumbList="";

            for (i = 1; i < 6; i++) {
                document.getElementById("img" + i).src = "http://<%=ServerURL %>/Upload/" + str + "_0" + i + ".jpg";
                
                if (hdnThumbList == "") {
                    hdnThumbList = str + "_0" + i + ".jpg";
                }
                else {
                    hdnThumbList += "/" + str + "_0" + i + ".jpg";
                }

            }
            document.getElementById("<%=hdnThumbList.ClientID %>").value = hdnThumbList;
            document.getElementById("selectPan").style.display = "block";
            document.getElementById("selectFile").style.display = "none";
            alert("대표 이미지를 선택해주세요."); */
        }
        function SetEncodingKind(idx) {
            document.getElementById("<%= hdnEncodingKind.ClientID%>").value = idx;
        }


    </script>
    <a href="http://ucclight.hoons.kr" target="_blank" ><img src="./img/ucclight.jpg" style="padding-left:10px" /></a>
<div style="border: solid 1px #CCCCCC; height: 100%; width: 600px; padding: 10px 10px 10px 10px;
        margin-top: 15px; margin-left: 10px;">
<div style="padding-bottom:5px;"><b>UCC동영상 올리기</b>(파일용량 제한 125메가)<br />
    <br />
    제목 : <asp:TextBox ID="txtSubject" runat="server" Width="520px" MaxLength="200"></asp:TextBox><br />
    이름 : <asp:TextBox ID="txtUserName" runat="server" Width="320px" MaxLength="200"></asp:TextBox><br />
</div>
<div style="width: 660px; padding-top: 10px;">
            <asp:TextBox ID="txtContent" runat="server" Height="300" TextMode="MultiLine" Width="597px"></asp:TextBox>
</div>
<div style="padding-bottom:5px;"><b>인코딩 옵션</b><br /><br />
            <input type ="radio" name ="EncodingGroup" id = "rdoEncodingKind1" value="0" onclick="SetEncodingKind(1)"; />&nbsp;저화질
         &nbsp;&nbsp;
            <input type ="radio" name ="EncodingGroup" id = "rdoEncodingKind2" onclick="SetEncodingKind(2)";/>&nbsp;중화질
            &nbsp;&nbsp;
           <input type ="radio" name ="EncodingGroup" id = "rdoEncodingKind3" onclick="SetEncodingKind(3)";/>&nbsp;고화질
            &nbsp;&nbsp;
            <input type ="radio" name ="EncodingGroup" id = "rdoEncodingKind4" onclick="SetEncodingKind(4)";/>&nbsp;Smooth Streaming
</div>
<div id="selectFile" style="width: 660px;text-align:center">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" Width="415" Height="280">
			<param name="source" value="ClientBin/UCCLIGHT2.FileUpload.xap"/>
			<param name="onerror" value="onSilverlightError" />
			<param name="background" value="white" />
			<param name="minRuntimeVersion" value="2.0.31005.0" />
			<param name="autoUpgrade" value="true" />
			<param name="initParams" value="MaxFileSizeKB=,CustomParam=yourparameters,DefaultColor=LightBlue" />
			<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
     			<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
			</a>
		</object>
		<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
     <br />
    
</div>


<br />
    <div  style="text-align:right;width:550px;"> 
        <asp:Button ID="btnInsert" runat="server" Text="등록하기" 
            onclick="btnInsert_Click" />
        <asp:Button ID="btnCancel" runat="server" Text="취소하기" 
            onclick="btnCancel_Click" />
        
    </div>
    </div>
<script type="text/javascript">
function validate()
{
    if(document.getElementById("<%=txtSubject.ClientID %>").value =='')
    {
        alert("제목을 입력하세요");
        document.getElementById("<%=txtSubject.ClientID %>").focus();
        return false;
    }
    else if (document.getElementById("<%=txtUserName.ClientID %>").value == '') {
        alert("이름을 입력하세요");
        document.getElementById("<%=txtUserName.ClientID %>").focus();
        return false;
    }
    else if (document.getElementById("rdoEncodingKind1").checked == false
        && document.getElementById("rdoEncodingKind2").checked == false
        && document.getElementById("rdoEncodingKind3").checked == false
        && document.getElementById("rdoEncodingKind4").checked == false
     ) {
        alert("인코딩 옵션을 선택해주세요.");
        document.getElementById("rdoEncodingKind1").focus();
        return false;
    }    
    else if(document.getElementById("<%=hdnFileName.ClientID %>").value =='')
    {
        alert("파일을 업로드 해 주세요");
        return false;
    }
    else {
        
        return true;
        
    }
}
</script>
    <input id="hdnThumb" type="hidden" runat="server"/>
    <input id="hdnThumbList" type="hidden" runat="server" />
    <input id="hdnFileName" type="hidden" runat="server" />
    <input id="hdnStatus" type="hidden" runat="server"/>
    <input id="hdnEncodingKind" type="hidden" runat="server"/>

    </form>
</body>
</html>
